# Copyright 2010-2025 Google LLC
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

package(default_visibility = ["//visibility:public"])

cc_library(
    name = "proto_utils",
    hdrs = ["proto_utils.h"],
    visibility = ["//visibility:public"],
    deps = [
        "//ortools/port:proto_utils",
        "@com_google_absl//absl/log:check",
        "@com_google_protobuf//:protobuf",
    ],
)

cc_library(
    name = "glop_proto_solver",
    srcs = ["glop_proto_solver.cc"],
    hdrs = ["glop_proto_solver.h"],
    deps = [
        ":proto_utils",
        "//ortools/glop:lp_solver",
        "//ortools/glop:parameters_cc_proto",
        "//ortools/glop:parameters_validation",
        "//ortools/linear_solver:linear_solver_cc_proto",
        "//ortools/linear_solver:model_validator",
        "//ortools/lp_data",
        "//ortools/lp_data:base",
        "//ortools/lp_data:proto_utils",
        "//ortools/port:proto_utils",
        "//ortools/util:lazy_mutable_copy",
        "//ortools/util:logging",
        "//ortools/util:time_limit",
        "@com_google_absl//absl/log",
        "@com_google_absl//absl/log:check",
        "@com_google_absl//absl/strings",
    ],
)

cc_library(
    name = "pdlp_proto_solver",
    srcs = ["pdlp_proto_solver.cc"],
    hdrs = ["pdlp_proto_solver.h"],
    deps = [
        "//ortools/base:logging",
        "//ortools/linear_solver:linear_solver_cc_proto",
        "//ortools/linear_solver:model_validator",
        "//ortools/pdlp:iteration_stats",
        "//ortools/pdlp:primal_dual_hybrid_gradient",
        "//ortools/pdlp:quadratic_program",
        "//ortools/pdlp:solve_log_cc_proto",
        "//ortools/pdlp:solvers_cc_proto",
        "//ortools/port:proto_utils",
        "//ortools/util:lazy_mutable_copy",
        "@com_google_absl//absl/status:statusor",
    ],
)

cc_library(
    name = "sat_solver_utils",
    srcs = ["sat_solver_utils.cc"],
    hdrs = ["sat_solver_utils.h"],
    deps = [
        "//ortools/glop:parameters_cc_proto",
        "//ortools/glop:preprocessor",
        "//ortools/linear_solver:linear_solver_cc_proto",
        "//ortools/lp_data:proto_utils",
        "//ortools/util:logging",
        "@com_google_absl//absl/memory",
    ],
)

cc_library(
    name = "sat_proto_solver",
    srcs = ["sat_proto_solver.cc"],
    hdrs = ["sat_proto_solver.h"],
    deps = [
        ":proto_utils",
        ":sat_solver_utils",
        "//ortools/glop:preprocessor",
        "//ortools/linear_solver:linear_solver_cc_proto",
        "//ortools/linear_solver:model_validator",
        "//ortools/lp_data",
        "//ortools/lp_data:base",
        "//ortools/port:proto_utils",
        "//ortools/sat:cp_model_cc_proto",
        "//ortools/sat:cp_model_solver",
        "//ortools/sat:lp_utils",
        "//ortools/sat:model",
        "//ortools/sat:parameters_validation",
        "//ortools/sat:sat_parameters_cc_proto",
        "//ortools/util:lazy_mutable_copy",
        "//ortools/util:logging",
        "//ortools/util:time_limit",
        "@com_google_absl//absl/log",
        "@com_google_absl//absl/log:check",
        "@com_google_absl//absl/strings",
        "@com_google_absl//absl/types:span",
    ],
)

cc_library(
    name = "scip_proto_solver",
    srcs = ["scip_proto_solver.cc"],
    hdrs = ["scip_proto_solver.h"],
    defines = select({
        "//ortools/linear_solver:use_scip": ["USE_SCIP"],
        "//conditions:default": [],
    }),
    deps = [
        "//ortools/base",
        "//ortools/base:timer",
        "//ortools/gscip:legacy_scip_params",
        "//ortools/linear_solver:linear_solver_cc_proto",
        "//ortools/linear_solver:model_validator",
        "//ortools/linear_solver:scip_helper_macros",
        "//ortools/util:lazy_mutable_copy",
        "@com_google_absl//absl/cleanup",
        "@com_google_absl//absl/container:btree",
        "@com_google_absl//absl/log",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/status:statusor",
        "@com_google_absl//absl/strings",
        "@com_google_absl//absl/strings:str_format",
        "@com_google_absl//absl/time",
    ] + select({
        "//ortools/linear_solver:use_scip": ["@scip"],
        "//conditions:default": [],
    }),
)

cc_library(
    name = "gurobi_proto_solver",
    srcs = ["gurobi_proto_solver.cc"],
    hdrs = ["gurobi_proto_solver.h"],
    deps = [
        "//ortools/base:timer",
        "//ortools/gurobi:environment",
        "//ortools/linear_solver:linear_solver_cc_proto",
        "//ortools/linear_solver:model_validator",
        "//ortools/util:lazy_mutable_copy",
        "@com_google_absl//absl/base:core_headers",
        "@com_google_absl//absl/cleanup",
        "@com_google_absl//absl/log",
        "@com_google_absl//absl/log:check",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/status:statusor",
        "@com_google_absl//absl/strings",
        "@com_google_absl//absl/strings:str_format",
        "@com_google_absl//absl/time",
        "@com_google_absl//absl/types:optional",
    ],
)

cc_library(
    name = "highs_proto_solver",
    srcs = ["highs_proto_solver.cc"],
    hdrs = ["highs_proto_solver.h"],
    defines = select({
        "//ortools/linear_solver:use_highs": ["USE_HIGHS"],
        "//conditions:default": [],
    }),
    deps = [
        "//ortools/base:timer",
        "//ortools/linear_solver:linear_solver_cc_proto",
        "//ortools/linear_solver:model_validator",
        "//ortools/port:proto_utils",
        "//ortools/util:lazy_mutable_copy",
        "@com_google_absl//absl/status:statusor",
        "@highs",
    ],
)

cc_library(
    name = "xpress_proto_solver",
    srcs = ["xpress_proto_solver.cc"],
    hdrs = ["xpress_proto_solver.h"],
    deps = [
        "//ortools/base:timer",
        "//ortools/linear_solver:linear_solver_cc_proto",
        "//ortools/linear_solver:model_validator",
        "//ortools/util:lazy_mutable_copy",
        "//ortools/xpress:environment",
        "@com_google_absl//absl/base:core_headers",
        "@com_google_absl//absl/cleanup",
        "@com_google_absl//absl/log",
        "@com_google_absl//absl/log:check",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/status:statusor",
        "@com_google_absl//absl/strings",
        "@com_google_absl//absl/strings:str_format",
        "@com_google_absl//absl/time",
        "@com_google_absl//absl/types:optional",
    ],
)
